package day_2022_12_to_3.day;

import java.util.Arrays;

/**
 * @author haomin
 * @date 2022/12/31 22:19
 **/
public class Day12_31_Num2037 {
    class Solution {
        public int minMovesToSeat(int[] seats, int[] students) {
            Arrays.sort(seats);
            Arrays.sort(students);
            int ans = 0;
            for(int i = 0; i < seats.length; i++){
                ans += Math.abs(seats[i] - students[i]);
            }
            return ans;
        }
    }
}